function refreshPage(page) { 

	window.location = 'http://m.southhillcalvary.org'+page; 

}

function warnDelete(multi, title, id, oldId) { 

	var x = confirm("If book is checked out, all data will be lost...\n\n contine?"); 

	if (x) {
	
		if (multi == "TRUE"){
			
			window.location = "http://m.southhillcalvary.org/librarydetail.php?title="+title+"&id="+id+"&oldId="+oldId+"&deleteBook=TRUE";
		}
		else if (multi == "ALL") {
			
			window.location = "http://m.southhillcalvary.org/librarydetailmultiple.php?title="+title+"&id="+id+"&deleteAll=TRUE";
		}
		else {
			
			window.location = "http://m.southhillcalvary.org/librarydetail.php?title="+title+"&id="+id+"&deleteBook=TRUE";

		}
	} 
}

function warnDuplicate (newTitle, newAuthor, newNumCopies, newGenre){
	
	var x = confirm("The book \""+newTitle+"\" already exists\n\n Do you want to add another copy/more copies?"); 
	
	if (x) {
	
		refreshPage("/lendinglibrary.php?skip=1&addCopy=1&newTitle="+newTitle+"&newAuthor="+newAuthor+"&newNumCopies="+newNumCopies+"&newGenre="+newGenre);
	}
	
	else refreshPage("/lendinglibrary.php?message=Cancelled");
}